package com.ysd.modules.app.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ysd.common.utils.R;
import com.ysd.modules.app.entity.ClassesEntity;
import com.ysd.modules.app.service.ClassesService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/app/classes")
@Api("APP班级接口")
public class ClassesController {
	
	@Autowired
	private ClassesService classesService;
	
	@GetMapping("/getClassesByStuId")
	@ApiOperation("根据学生id查询班级")
	public R getClassesByStuId(Integer stuId) {
		ClassesEntity c = classesService.getByStudentId(stuId);
        Map<String, Object> map = new HashMap<>();
        map.put("code", 0);
        map.put("msg", "success");
        map.put("data", c);
		return R.ok(map);
	}
	
}
